﻿<UserControl x:Class="EasyInvoice.WPF.Content.Invoice"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:mui="http://firstfloorsoftware.com/ModernUI"
			 xmlns:app="clr-namespace:EasyInvoice.WPF"
			 xmlns:vm="clr-namespace:EasyInvoice.WPF.ViewModel">
	<UserControl.Resources>

	</UserControl.Resources>
	<ScrollViewer Margin="{StaticResource RootMargin}">
		<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
				<StackPanel.Resources>
					<Style TargetType="StackPanel">
						<Setter Property="Orientation" Value="Horizontal" />
						<Setter Property="Margin" Value="0,0,0,4" />
					</Style>
					<Style TargetType="TextBlock">
						<Setter Property="Width" Value="120" />
						<Setter Property="VerticalAlignment" Value="Center" />
					</Style>
				</StackPanel.Resources>
				<TextBlock Text="Invoice" Style="{StaticResource Title}" Margin="0,8,0,8"  />
				<StackPanel>
					<TextBlock Text="Number"/>
					<TextBox  Width="350" Text="{Binding Number,Mode=TwoWay,ValidatesOnDataErrors=True}"/>
				</StackPanel>
				<StackPanel>
					<TextBlock Text="Date"/>
					<DatePicker  Width="350" Text="{Binding Date,Mode=TwoWay, ValidatesOnDataErrors=True}"/>
				</StackPanel>
				<StackPanel>
					<TextBlock Text="Client"/>
					<ComboBox Width="350" 
							  ItemsSource="{Binding Source={StaticResource clientsComboDataSource}}" 
							  SelectedItem="{Binding Client,Mode=TwoWay, ValidatesOnDataErrors=True}" DisplayMemberPath="Name" />
				</StackPanel>
				<StackPanel Margin="0,0,0,32">
					<TextBlock Text="Seller"/>                   
					<ComboBox Width="350" 
							  ItemsSource="{Binding Source={StaticResource sellersComboDataSource}}" 
							  SelectedItem="{Binding Seller,Mode=TwoWay, ValidatesOnDataErrors=True}" 
							  DisplayMemberPath="Name"
							 />
				</StackPanel>
			   
				<TextBlock Text="Details" Style="{StaticResource Heading2}" Margin="0,0,0,8" />
				
				<DockPanel>
					<DataGrid AutoGenerateColumns="False" 
							  ItemsSource="{Binding Details,Mode=TwoWay}" 
							  DockPanel.Dock="Top" >
						<DataGrid.Columns>
							<mui:DataGridTextColumn Header="Description" Binding="{Binding Description,Mode=TwoWay}"/>
							<mui:DataGridTextColumn Header="Unit Price" Binding="{Binding Price, Mode=TwoWay}"/>
							<mui:DataGridTextColumn Header="Quantity" Binding="{Binding Units,Mode=TwoWay}"/>
							<mui:DataGridTextColumn Header="Amount" Binding="{Binding Value}" IsReadOnly="True"/>
							</DataGrid.Columns>
					</DataGrid>
				</DockPanel>
				<!--<DockPanel DockPanel.Dock="Top" HorizontalAlignment="Right" Margin="0,0,0,8">
					<mui:ModernButton 
							x:Name="saveModernButton"
							IconData="M 20.5833,20.5833L 55.4167,20.5833L 55.4167,55.4167L 45.9167,55.4167L 45.9167,44.3333L 30.0833,44.3333L 30.0833,55.4167L 20.5833,55.4167L 20.5833,20.5833 Z M 33.25,55.4167L 33.25,50.6667L 39.5833,50.6667L 39.5833,55.4167L 33.25,55.4167 Z M 26.9167,23.75L 26.9167,33.25L 49.0833,33.25L 49.0833,23.75L 26.9167,23.75 Z "
							Command="{Binding ShowSaveCommand}"
							ToolTip="save invoice"/>
					<mui:ModernButton 
							x:Name="printModernButton"
							IconData="M 36.3069,56.4426C 34.0702,58.5195 30.0833,62.75 32.7881,62.0168C 37.1473,59.3959 39.8714,50.9915 42.094,45.3712C 39.5065,39.6288 42.0013,35.1728 43.9683,35.0417C 46.3648,34.8819 46.9895,39.4244 46.9895,39.4244C 46.9895,39.4244 44.3333,37.4167 43.9284,36.1928C 43.4703,36.3073 42.9792,40.0292 44.3333,44.1458C 45.9167,42.1667 46.7083,40.1875 46.7083,40.1875C 46.7083,40.1875 48.6875,42.1667 45.7172,45.205C 46.2479,46.3813 49.1405,51.1227 50.4509,51.9807C 58.75,49.75 59.1457,54.1261 59.1457,54.1261C 57.8643,52.9561 55.0287,52.8353 51.8787,53.1741C 55.8527,55.2618 59.2167,54.5712 59.2167,54.5712C 59.2167,56.206 53.8333,58 49.8596,54.2353C 45.6983,54.888 41.4481,56.8904 39.7663,57.3957C 35.2719,65.2481 30.3574,64.6256 29.6875,62.75C 28.5,59.5833 36.3069,56.4426 36.3069,56.4426 Z M 43.9949,46.8185L 41.0559,54.9219C 42.7814,54.4274 44.6885,53.4792 48.1081,52.8076C 47,52 46,51 43.9949,46.8185 Z M 20,17L 43.25,17L 56,29.75L 56,50L 52,50.25L 52,34L 39,34L 39,21L 24,21L 24,55L 34.5,55L 30,59L 20,59L 20,17 Z M 40,59L 40,58.5L 49,55.5L 56,59L 40,59 Z M 43,22.25L 43,30L 50.75,30L 43,22.25 Z "
							Command="{Binding DeleteCommand}"
							ToolTip="print invoice"/>
				</DockPanel>-->
				<StackPanel>
					<TextBlock/>
					<Button Command="{Binding ShowSaveCommand}" Content="save" Margin="0,32,0,8" Width="140"/>
				</StackPanel>
			</StackPanel>
		</ScrollViewer>
</UserControl>
